dasding = (typeof(dasding) === 'undefined') ? {} : dasding;
dasding.templates = (typeof(dasding.templates) === 'undefined') ? {} : dasding.templates;

dasding.templates.eventsList = "    <div class='dd_events_list'>\
      <h3>Event-Liste</h3>\
      <% _.each( results, function( item, i ){ %>\
        <div class='dd_eventlist_item span12 box no-left_margin'>\
          <% var contact = item.get('contact'); %>\
          <% var category = item.get('category'); %>\
          <% var datum = formatDate(item.get('time'));  %>\
          <% var uhrzeit = formatTime(item.get('time'));  %>\
          <div class='row-fluid'>\
            <div class='dd_name span12'><a href='event.shtml?id=<%= item.get('id') %>'><%= item.get('name') %></a></div>\
          </div>\
          <div class='row-fluid'>\
            <div class='dd_description span12'><%= item.get('description') %></div>\
          </div>\
          <div class='row-fluid'>\
            <div class='dd_datetime span6'><%= datum %> <%= uhrzeit %></div>\
            <div class='dd_category span6'>\
              <%= category.name %>\
              <span class='dd_tooltip'>D\
                <span>\
                  <%= category.description %>\
                </span>\
              </span>\
            </div>\
          </div>\
          <div class='row-fluid'>\
            <div class='dd_location span12'>\
              <% var location = item.get('location'); %>\
              <%= location.name %>, <%= location.zip %> <%= location.city %>\
            </div>\
          </div>\
          <div class='row-fluid'>\
            <div class='dd_actionlist_container dd_opener_container span6 box' onClick='$(\".dd_opener_content\", this).toggle();'>\
              <h5>Aufgaben v</h5>\
              <div class='dd_actionlist dd_opener_content'>\
              <% var actions = item.get('actions'); %>\
              <% _.each( actions.action, function( action, i ){ %>\
                <div class='dd_actionlist_item'>\
                  <% var currentAction = action; %>\
                  <%= action.name %><br /><%= action.description %> -> <br />\
                  <hr />\
                </div>\
              <% }); %>\
              </div>\
            </div>\
            <div class='dd_contact_container dd_opener_container span6 box' onClick='$(\".dd_opener_content\", this).toggle();'>\
              <h5>Kontakt v</h5>\
              <div class='dd_contact dd_opener_content'>\
                <%= contact.fullname %>\
              </div>\
            </div>\
          </div>\
        </div>\
      <% }); %>\
";


dasding.templates.eventDetails = "      <div id='dd_event_details' class='box no-left_margin'>\
        <h3><%= currentEventData.name %></h3>\
          <div class='row-fluid'>\
            <div class='dd_label span4'>Name:</div>\
            <div class='span8'><%= currentEventData.name %></div>\
          </div>\
          <div class='row-fluid'>\
            <div class='dd_label span4'>Beschreibung:</div>\
            <div class='span8'><%= currentEventData.description %></div>\
          </div>\
          <div class='row-fluid'>\
            <div class='dd_label span4'>Termin:</div>\
            <div class='span8'><%= currentEventData.time %></div>\
          </div>\
          <div class='row-fluid'>\
            <% var location = currentEventData.location; %>\
            <div class='dd_label span4'>Location:</div>\
            <div class='span8'>\
              <%= location.name %> <br />\
              <%= location.zip %> <%= location.city %>\
            </div>\
          </div>\
          <div class='row-fluid'>\
              <h4>Aktionen</h4>\
              <% var actions = currentEventData.actions; %>\
              <% _.each( actions.action, function( action, i ){ %>\
              <% var currentAction = action; %>\
              <% console.log(action) %>\
            <div class='span12 box no-left_margin dd_<%= action.status %>'>\
              <div class='row-fluid'>\
                  <div class='dd_label span4'>Aktion</div>\
                  <div class='span8'><%= action.name %></div>\
              </div>\
              <div class='row-fluid'>\
                <div class='dd_label'>Description</div>\
                <div><%= action.description %></div>\
              </div>\
              <div class='row-fluid'>\
                <div class='dd_label span4'>Status</div>\
                <div class='span8'><%= action.status %></div>\
              </div>\
              <div class='row-fluid'>\
                <div class='dd_label span4'>Categorie</div>\
                <div class='span8'><strong><%= action.category.name %></strong><br /><%= action.category.description %></div>\
              </div>\
              <div class='row-fluid'>\
                <div class='dd_label span4'>Location</div>\
                <div class='span8'><%= action.location.name %></div>\
              </div>\
              <div class='row-fluid'>\
                <div class='dd_label span4'>Contact</div>\
                <div class='span8'><%= action.contact.fullname %></div>\
              </div>\
            </div>\
            <% }); %>\
          </div>\
        <% console.log('-----'); %>\
        <% console.log(currentEventData.name); %>\
        <% console.log('-----'); %>\
      </div>\
";

dasding.templates.eventCreate = "      <div id='dd_create_event'>\
        <h3>Neues Event: <span id='#title'></span></h3>\
        <form>\
          <div class='dd_form_row'>\
            <input type='submit' value='Submit'></input>\
          </div>\
          <div class='dd_form_row'>\
            <label for='dd_event_name'>Event-Titel</label>\
            <input name='dd_event_name' type='text' />\
          </div>\
          <div class='dd_form_row'>\
            <label for='dd_event_decription'>Event-Beschreibung</label>\
            <textarea name='dd_event_description' type='text'></textarea>\
          </div>\
          <div class='dd_form_row'>\
            <label for='dd_event_category'>Event-Kategorie</label>\
            <div class='dd_json_select'>\
              <select class='dd_event_category' name='dd_event_category' type='text'>\
              </select>\
              <div class='dd_select_tooltip'></div>\
            </div>\
          </div>\
          <div class='dd_form_row'>\
            <label for='dd_event_time'>Event-Zeit</label>\
            <input name='dd_event_time' type='text' />\
          </div>\
          <div class='dd_form_row'>\
            <label for='dd_event_location'>Event-Location</label>\
            <input name='dd_event_location' type='text' />\
          </div>\
          <div class='dd_form_row'>\
            <input type='submit' value='Submit'></input>\
          </div>\
        </form>\
      </div>\
";